package com.kapcb.common.function;

import java.util.function.Consumer;

/**
 * <a>Title: PresentHandler </a>
 * <a>Author: Kapcb <a>
 * <a>Description: 空值与非空值分支处理 <a>
 *
 * @author Kapcb
 * @version 1.0
 * @date 2024/4/21 11:15
 * @since 1.0
 */
@FunctionalInterface
public interface PresentHandler<T> extends Branch {

    /**
     * do present
     *
     * @param consumer 值不为空时，执行的消费操作 {@link Consumer}
     * @param runnable 值为空时，执行的操作 {@link Runnable}
     */
    void presentOrElseHandle(Consumer<? super T> consumer, Runnable runnable);

}
